const arr = [ [ 'name', '蜗牛' ], [ 'age', 19 ], [ 'gender', '男' ] ]

// 数组转成对象
// const res = Object.fromEntries(arr) //{ name: '蜗牛', age: 19, gender: '男' }
// console.log(res);


Object.prototype.my_fromEntries = function(arr) {
    let obj = {}
    for(let i = 0; i < arr.length; i++) {
        const [key, value] = arr[i]
        obj[key] = value
    }
    return obj
}

const res = Object.my_fromEntries(arr)
console.log(res);